	function GetQueryString(key) {
		// key为url变量名称
		var urlGets = location.search.substr(1);
		if(urlGets.length > 0) {
			start = urlGets.indexOf(key + '=');
			if(start != -1) {
				start = start + key.length + 1;
				end = urlGets.indexOf('&', start)
				if(end == -1) {
					end = urlGets.length
				}
				return decodeURIComponent(urlGets.substring(start, end))
			}
		}
		return '';
	}
	var dkk=document.getElementById('dae');
				var str = dkk.innerHTML;
var mtype=1;
(function($, window, document, undefined) {
	//  alert(GetQueryString('mt'));

	var userPicker = new $.PopPicker();
	var userPicker1 = new $.PopPicker();
//	刷新按钮变色效果
	refresh.addEventListener('touchstart',function(){
		refresh.style.background='#D8D8D8'
	});
	refresh.addEventListener('touchend',function(){
		refresh.style.background='white';
		setTimeout(function(){
			refresh.style.display='none';
			get(0,5000,12);
		},500)
	});
//	贷款金额
	userPicker.setData([{
				value: 'ywj',
				text: 500
			}, {
				value: 'aaa',
				text: 1000
			}, {
				value: 'aaa',
				text: 2000
			}, {
				value: 'aaa',
				text: 3000
			}, {
				value: 'lj',
				text: 4000
			}, {
				value: 'ymt',
				text: 5000
			}, {
				value: 'shq',
				text: 10000
			}, {
				value: 'zhbh',
				text: 15000
			}, {
				value: 'zhy',
				text: 20000
			}, {
				value: 'gyf',
				text: 30000
			}, {
				value: 'zhz',
				text: 50000
			}, {
				value: 'gezh',
				text: 100000
			}]);
	userPicker1.setData([{
		value: 'ywj',
		text: 1
	}, {
		value: 'aaa',
		text: 2
	}, {
		value: 'lj',
		text: 3
	}, {
		value: 'ymt',
		text: 6
	}, {
		value: 'shq',
		text: 12
	}, {
		value: 'zhbh',
		text: 18
	}, {
		value: 'zhy',
		text: 24
	}, {
		value: 'gyf',
		text: 36
	}, {
		value: 'zhz',
		text: 48
	}]);
	var showUserPickerButton11 = document.getElementById('UserPicker1');
	var showUserPickerButton22 = document.getElementById('UserPicker2');
	var userResult1 = document.getElementById('userResult11');
	var userResult2 = document.getElementById('userResult22');
	userResult11.innerHTML = GetQueryString('pp');
	userResult22.innerHTML = GetQueryString('mt');
	showUserPickerButton11.addEventListener('tap', function(event) {
		userPicker.show(function(items) {
			userResult1.innerText = items[0].text;
			str='';
			get(userResult1.innerText,userResult2.innerText);
			//返回 false 可以阻止选择框的关闭
			//return false;
		});
	}, false);
	showUserPickerButton22.addEventListener('tap', function(event) {
		userPicker1.show(function(items) {
			userResult2.innerText = items[0].text;
			str='';
			get(userResult1.innerText,userResult2.innerText);
			//返回 false 可以阻止选择框的关闭
			//return false;
		});
	}, false);
})(window.mui || window, window, document, undefined);
	//开始
	function get(money,mday) {
		
//		alert(GetQueryString('mtype')+":"+GetQueryString('pp')+":"+GetQueryString('mt'));
		$.ajax({
		type: 'get',
		url: httpAdress + '/api/borrow/product/searchproduct',
		contentType: "application/json; charset=utf-8",
		dataType: 'jsonp',
		data: {
				'type_a': GetQueryString("mtypea"),
				'type_b': GetQueryString("mtype"), //对象类型
				'money': money, //贷款金额
				'day': mday, //贷款期限
				first:count
			},
		jsonp: "callback",
		jsonpCallback: "successCallback",
			success: function(data) {
//				alert(JSON.stringify(data));
				var mydata = data.data;
//				alert(GetQueryString("mtypea"))
//				console.log(data.data);
//           	 console.log(JSON.parse(data).id)
//				var proid=mydata.id;
				//				userResult1.innerText = mydata.money;
				//				userResult2.innerText = mydata.day;
				
				var strlogin='';
				if(mydata.length<10){
					document.getElementById("addmore").innerHTML='没有更多了';
				}
				for(var i = 0; i < mydata.length; i++) {
					var strstart1 = '';
						var strstart2 = '';
						for(var a = 0; a < mydata[i].start; a++) {
							strstart1 += ' <img src="../../img/daikuan/img-star@3x.png"/>'
						}
						for(var b = 0; b < (5 - mydata[i].start); b++) {
							strstart2 += ' <img src="../../img/daikuan/img-star-half@3x.png"/>'
						}
					str +=
						'<li class=" mui-media listb">' +
                        '<a class="dispaly-flex" href="'+'../../HTML/home/home_fast_detail.html?mproid=' + mydata[i].id +'&mdname=' + mydata[i].name +'">' +
                        '<img class="item-img mui-media-object mui-pull-left" src="' + httpAdress + mydata[i].logo + '">' +
                        '<div class="mui-media-body">' +
                        '<div class="top">' +
                        ' <span class="mui-media-body-name">' + mydata[i].name + '</span>' +
                        strstart1 + strstart2 +
                        '</div>' +
                        '<div class="block">' +
                        '<span class="mation">下款人数</span><br />' +
                        '<span class="num">' + mydata[i].count + '人</span>' +
                        '</div>' +
                        '<div class="block" style="text-align: center;">' +
                        '<span class="mation">月利率</span><br />' +
                        '<span class="lilv">' + mydata[i].rate + '</span>' +
                        ' </div>' +
                        '<div class="block">' +
                        '<span class="mation">放款时间</span><br />' +
                        '<span class="num">' + mydata[i].loan_time + '</span>' +
                        '</div></div> </a></li>';
				}
				dkk.innerHTML = str;
				if(str==''){					
					document.getElementById("addmore").style.display='none'
			}else{
					document.getElementById("addmore").style.display='block';					
				}	
			},
			error: function() {
				mui.toast('加载失败，刷新一下');
				refresh.style.display='block';
				//				plus.nativeUI.closeWaiting();
			}
		});
}
	var count=0;
	get(GetQueryString('pp'),GetQueryString('mt'));
	document.getElementById('addmore').addEventListener('tap',function () {
	        count=count+10;
	        get(GetQueryString('pp'),GetQueryString('mt'));
	})
	//			结束
	//底部导航栏点击事件
//var userup=localStorage.getItem('userid');
//	
//	var arrqq = ['../home/home.html', 'daikuan.html', '../bank/credit_card.html', '../login/login.html'];
//var muitabitem = document.getElementsByClassName('mui-tab-item');
//	function change(o){
//		muitabitem[o].addEventListener('tap',function() {
//			document.location.href = arrqq[o];
//			if(o==3&&userup!==null){
//				document.location.href='../my/my.html';
//			}
//		});
//	}
//	for(var i = 0; i < 4; i++) {
//		change(i);
//	}